<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="<%=application.getContextPath() %>/css/bug.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="<%=application.getContextPath()%>/css/jquery-ui-1.8.17.custom.css"/>
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery-1.6.min.js"></script>	
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery-ui-1.8.17.custom.min.js"></script>	
<script language="JavaScript" src="<%=application.getContextPath()%>/js/gen_validatorv4.js" type="text/javascript" ></script>
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery.validate.js"></script>	
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery.validate.min.js"></script>
<title>.::: Intelligent Bug Tracker :::.</title>

<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<script language="javascript">

        function addRow(userTable) {
 
            var table = document.getElementById(userTable);
 			var rowCount = table.rows.length;
			var row = table.insertRow(rowCount);
			
			
			table.setAttribute("bgColor", "#C5E4EB");
		    var cell0=row.insertCell(0);
		    cell0.setAttribute("bgColor","#FFFFFF");
		    cell0.innerHTML='<input type="checkbox" name="chkbox"/>';
			var cell1 = row.insertCell(1);
		    cell1.innerHTML = rowCount ;
           	cell1.setAttribute("bgColor","#FFFFFF");
                      	
            var cell2 = row.insertCell(2);
            cell2.setAttribute("bgColor","#FFFFFF");
            var element2 = document.createElement("input");
			element2.type = "text";
			element2.name="module"+rowCount;
			element2.id="module"+rowCount;
			element2.className="user";
			element2.size="15";
            cell2.appendChild(element2);
            
            
            var cell3 = row.insertCell(3);
            cell3.setAttribute("bgColor","#FFFFFF");
            var element3 = document.createElement("input");
			element3.type = "text";
			element3.name="desc"+rowCount;
			element3.id="desc"+rowCount;
			element3.className="user";
			element3.size="15";
            cell3.appendChild(element3);
            
            

			var cell4 = row.insertCell(4);
			cell4.setAttribute("bgColor","#FFFFFF");
			 var element4= document.createElement("input");
				element4.type = "text";
				element4.name="other"+rowCount;
				element4.id="other"+rowCount;
				element4.className="user";
				element4.size="15";
	            cell4.appendChild(element4);
			
       
 			 var colcount=parseInt($("#rowcount").val());
 			 colcount=colcount+1;
 			 $("#rowcount").val(colcount);
 			 $("#userName"+rowCount).focus();

        }
 
        
        function deleteRow(userTable) {
            try {
            var table = document.getElementById(userTable);
            var rowCount = table.rows.length;
 			
            for(var i=0; i<rowCount; i++) {
                var row = table.rows[i];
                var chkbox = row.cells[0].childNodes[0];
                if(null != chkbox && true == chkbox.checked) {
                    table.deleteRow(i);
                    rowCount--;
                    i--;
                }
 
            }
			for(var i=0; i<rowCount-1; i++)

           table.rows[i+1].cells[1].innerHTML = i+1;
            }catch(e) {
               // alert(e);
            }
            
            
            var colcount=parseInt($("#rowcount").val());
			 var initcount=parseInt($("#initCount").val());
			 colcount=colcount-1;
			 $("#rowcount").val(colcount);
			
			 //alert(colcount);
        }
       

    </script>
<script src="<%=application.getContextPath() %>/Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<link href="<%=application.getContextPath() %>/css/bug.css" rel="stylesheet" type="text/css" />
</head>

<body onload="MM_preloadImages('<%=application.getContextPath() %>/images/home-r.gif','<%=application.getContextPath() %>/images/admin-r.gif','<%=application.getContextPath() %>/images/proj-r.gif','<%=application.getContextPath() %>/images/bug-r.gif')">
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td width="900" height="50" align="left" valign="top" background="<%=application.getContextPath() %>/images/header.gif">      <table width="900" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="341">&nbsp;</td>
          <td width="499" align="left" valign="top"><table width="408" border="0" cellspacing="0" cellpadding="0">
              <tr>
              <td width="93" align="left" valign="top"><a href="<%=application.getContextPath() %>/newbug/showall.do" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','<%=application.getContextPath() %>/images/home-r.gif',1)"><img src="<%=application.getContextPath() %>/images/home.gif" name="Image5" width="92" height="50" border="0" id="Image5" /></a></td>
                <td width="116" align="left" valign="top"><a href="<%=application.getContextPath() %>/jsp/admin.jsp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','<%=application.getContextPath() %>/images/admin-r.gif',1)"><img src="<%=application.getContextPath() %>/images/admin.gif" name="Image6" width="127" height="50" border="0" id="Image6" /></a></td>
                <td width="96" align="left" valign="top"><a href="<%=application.getContextPath() %>/jsp/projectmanager.jsp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image7','','<%=application.getContextPath() %>/images/proj-r.gif',1)"><img src="<%=application.getContextPath() %>/images/proj-r.gif" name="Image7" width="148" height="50" border="0" id="Image7" /></a></td>
                <td width="103" align="left" valign="top"><a href="<%=application.getContextPath() %>/jsp/bugmanager.jsp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image8','','<%=application.getContextPath() %>/images/bug-r.gif',1)"><img src="<%=application.getContextPath() %>/images/bug.gif" name="Image8" width="127" height="50" border="0" id="Image8" /></a></td>
              </tr>
          </table></td>
          <td width="60">&nbsp;</td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td width="900" height="800" align="left" valign="top" background="<%=application.getContextPath() %>/images/header-blue.gif" style="background-position:top; background-repeat:no-repeat"><table width="900" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="800" align="left" valign="top" background="<%=application.getContextPath() %>/images/bottmobg.gif" style="background-position:bottom; background-repeat:no-repeat"s><table width="900" border="0" cellspacing="0" cellpadding="0">
          
          <tr>
            <td width="57">&nbsp;</td>
            <td width="211" align="left" valign="top"><table width="211" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><img src="<%=application.getContextPath() %>/images/logo.gif" width="211" height="161" /></td>
                </tr>
              <tr>
                <td><img src="<%=application.getContextPath() %>/images/side-hed.gif" width="211" height="44" /></td>
                </tr>
              <tr>
                <td> <table width="211" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="24" align="left" valign="top" background="<%=application.getContextPath() %>/images/link-bg.gif"><table width="211" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="44">&nbsp;</td>
                              <td width="167" class="serices"><a href="<%=application.getContextPath() %>/jsp/addproject.jsp" >AddProject</a></td>
                            </tr>
                        </table></td>
                      </tr>
                    <tr>
                      <td height="24" align="left" valign="top" background="<%=application.getContextPath() %>/images/link-bg.gif"><table width="211" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="44">&nbsp;</td>
                              <td width="167" class="serices"><a href="<%=application.getContextPath() %>/jsp/editproject.jsp" >EditProject</a></td>
                            </tr>
                        </table></td>
                      </tr>
                    <tr>
                      <td height="24" align="left" valign="top" background="<%=application.getContextPath() %>/images/link-bg.gif"><table width="211" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="44">&nbsp;</td>
                              <td width="167" class="serices">DeleteProject</td>
                            </tr>
                        </table></td>
                      </tr>
                    <tr>
                      <td height="24" align="left" valign="top" background="<%=application.getContextPath() %>/images/link-bg.gif"><table width="211" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="44">&nbsp;</td>
                              <td width="167" class="serices"><a href="<%=application.getContextPath() %>/module/show.do" >Add BuildId</a></td>
                            </tr>
                        </table></td>
                      </tr>
                    <tr>
                      <td height="24" align="left" valign="top" background="<%=application.getContextPath() %>/images/link-bg.gif"><table width="211" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="44">&nbsp;</td>
                              <td width="167" class="serices"><a href="<%=application.getContextPath() %>/module/show.do" >Edit BuildId</a></td>
                            </tr>
                        </table></td>
                      </tr>
                   
                    <tr>
                      <td align="left" valign="top"><img src="<%=application.getContextPath() %>/images/bo.gif" width="211" height="14" /></td>
                      </tr>
                    <tr>
                      <td align="left" valign="top" background="<%=application.getContextPath() %>/images/bg-bo.gif"><table width="211" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td>&nbsp;</td>
                              <td>&nbsp;</td>
                              <td>&nbsp;</td>
                            </tr>
                        <tr>
                          <td height="300">&nbsp;</td>
                              <td>&nbsp;</td>
                              <td>&nbsp;</td>
                            </tr>
                        <tr>
                          <td>&nbsp;</td>
                              <td>&nbsp;</td>
                              <td>&nbsp;</td>
                            </tr>
                        </table></td>
                      </tr>
                    <tr>
                      <td align="left" valign="top"><img src="<%=application.getContextPath() %>/images/bg-bo-bo.gif" width="211" height="17" /></td>
                      </tr>
                    <tr>
                      <td align="left" valign="top">&nbsp;</td>
                      </tr>
                    <tr>
                      <td align="left" valign="top">&nbsp;</td>
                      </tr>
                  </table></td>
                </tr>
            </table></td>
            <td width="632" align="left" valign="top"><table width="632" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="122" align="left" valign="top"><table width="632" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="53">&nbsp;</td>
                    </tr>
                    <tr>
                      <td height="67" align="right" valign="top"><span class="side-he1"><br />
                        Intelligent Bug Tracker</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td><table width="632" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="5"></td>
                      <td height="5" bgcolor="#C8E2F5"></td>
                      <td height="5" bgcolor="#C8E2F5"></td>
                    </tr>
                    <tr>
                      <td height="2"></td>
                      <td height="2"></td>
                      <td height="2"></td>
                    </tr>
                    <tr>
                      <td width="511" height="5"></td>
                      <td width="121" height="5" bgcolor="#FFFFFF"></td>
                      <td width="121" height="5" bgcolor="#C8E2F5"></td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td align="right">&nbsp;</td>
              </tr>
              <tr>
                <td align="right"><a href="<%=application.getContextPath() %>/login/logout.do"><img src="<%=application.getContextPath() %>/images/signout.gif" /></a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
              </tr>
              <tr>
                <td align="left" valign="top"> <table width="632" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="22">&nbsp;</td>
                        <td width="594">&nbsp;</td>
                        <td width="16">&nbsp;</td>
                      </tr>
                    <tr>
                      <td>&nbsp;</td>
                        <td align="left" valign="top" class="content"><span class="side-he">Adding Project  </span><br />
                          <br /></td>
                        <td>&nbsp;</td>
                      </tr>
                    <tr>
                      <td height="5"></td>
                        <td height="5"><div id="Msg" align="center" class="result_msg" >
    <% 
    	if(request.getAttribute("msg")!=null){
    		out.println(request.getAttribute("msg"));
    	}
    	
    %>
    </div></td>
                        <td height="5"></td>
                      </tr>
                    <tr>
                      <td height="1"></td>
                        <td height="1" bgcolor="#C9E2F4"></td>
                        <td height="1"></td>
                      </tr>
                    <tr>
                      <td>&nbsp;</td>
                        <td align="center" valign="top">
                        <form id='grpfrm1' action='<%=application.getContextPath()%>/newproject/add.do' method="post">
        <table  border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="95">&nbsp;</td>
                <td width="182">&nbsp;</td>
                <td width="42">&nbsp;</td>
                <td width="98">&nbsp;</td>
                <td width="183">&nbsp;</td>
              </tr>
              <tr>
                <td class="content">ProjectName</td>
                <td><input name="pname" type="text" class="form" id="textfield" /></td>
                <td>&nbsp;</td>
                <td class="content">ProjectVersion</td>
                <td><input name="pver" type="text" class="form" id="textfield" /></td>
              </tr>
              <tr>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td class="content">ProjectManager</td>
                <td><input name="pmanager" type="text" class="form" id="textfield2" /></td>
                <td>&nbsp;</td>
                <td class="content">StartDate</td>
                <td><input name="sdate" type="text" class="form" id="stdate" /></td>
              </tr>
              <tr>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td class="content">End Date</td>
                <td><input name="edate" type="text" class="form" id="enddate" /></td>
                <td>&nbsp;</td>
                <td class="content">NoOfModules</td>
                <td><input name="nom" type="text" class="form" id="textfield3" /></td>
              </tr>
              <tr>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
             
              <tr>
                <td class="content">Description</td>
                <td><input name="pdesc" type="text" class="form" id="textfield6" /></td>
                <td>&nbsp;</td>
                <td class="content"></td>
                <td></td>
              </tr>
              <tr>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="content">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
             
            </table></td>
          </tr>
          <tr>
            <td> <div class="boxIFS">

        <table width="100%" id="userTable" border="0" cellpadding="4" cellspacing="1" bgcolor="#C5E4EB">
          <tr>
          	 <td width="36" height="30" align="left" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"  style="background-repeat:repeat-x"> </td>
            <td width="36" height="30" align="left" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"  style="background-repeat:repeat-x">S.No </td>
            <td width="138" align="left" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">ModuleName</td>
            <td width="138" align="left" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Module Desc</td>
            <td width="140" align="left" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Project Name</td>
          </tr>
          <tr>
          	<td align="center" valign="middle" bgcolor="#FFFFFF"><input type="checkbox" name="chkbox"/></td>
            <td bgcolor="#FFFFFF">1</td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input type="text" name="module1"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input type="text" name="desc1"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input type="text" name="other1"/></td>
          </tr>
        </table>
         <div class="box3">	
        	<div class="buttonleft"><a href="javascript: addRow('userTable')" >Add Row</a></div> 
                         <div class="buttonleft"><a href="javascript: deleteRow('userTable')" >Delete Row</a></div>
                      	 <input type="hidden" id="rowcount" name="rowcount" value="1"/>
                        </div>         
               
	  </div></td>
          </tr>
           <tr>
            <td align="right">
            <table align="center">
            <tr><td>
            <div class="box3">
	    			<div class="buttton-main">
	    				<input type="button" class="button" value="Edit" onclick="javascript: retriveClient()"/>
	    				<input type="reset" class="button" value="Clear" />
	    				<input type="submit" class="button" value="Save" onclick=" javascript : processFormData();"/>
	    			</div>
	  			</div></td></tr></table></td>
          </tr>
        </table></form>
                        </td>
                        <td>&nbsp;</td>
                      </tr>
                  </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="34" bgcolor="#2a44b4">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<script type="text/javascript">
	$(function() {
		$( "#stdate" ).datepicker({ dateFormat: "dd-mm-yy" },"option", "autoSize", true);
	
		$( "#enddate" ).datepicker({ dateFormat: "dd-mm-yy" },"option", "autoSize", true);
	});
   
      
      </script>